﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;


namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class OInspectionList : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看, Permission.修改, Permission.新增, Permission.删除 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "OInspectionList";
            }
        }
        #region 属性 (查询条件)

        protected override string orderField
        {
            get
            {
                return string.IsNullOrEmpty(base.orderField) ? "SerialNumber" : base.orderField;
            }
        }
        protected override string orderDirection
        {
            get
            {
                return string.IsNullOrEmpty(base.orderDirection) ? "Desc" : base.orderDirection;
            }
        }

        protected string t {
            get {
                return GetRequestValue<string>("t", "1");
            }
        }
        protected string SourceType
        {
            get
            {
                if (t == "1") return "完检单";
                if (t == "2") return "出库检查单";
                return "完检单";
            }
        }
        protected string MachineType
        {
            get
            {
                return GetRequestValue<string>("MachineType", "");

            }
        }
        protected string SerialNumber
        {
            get
            {
                return GetRequestValue<string>("SerialNumber", "");

            }
        }
        protected string DownlineDateFrom
        {
            get
            {
                return GetRequestValue<string>("DownlineDateFrom", "");

            }
        }
        protected string DownlineDateTo
        {
            get
            {
                return GetRequestValue<string>("DownlineDateTo", "");

            }
        }
        protected string DJNGItemCode
        {
            get
            {
                return GetRequestValue<string>("DJNGItemCode", "");

            }
        }
        protected string BZNGItemCode
        {
            get
            {
                return GetRequestValue<string>("BZNGItemCode", "");

            }
        }


       
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            DataBind();
          //  this.AddLog(Permission.查看, MachineType+SerialNumber+DownlineDateFrom+DownlineDateTo+DJNGItemCode+BZNGItemCode);
        }

        protected void DataBind()
        {
            this.rpMenu.DataSource = OInspectionController.GetPagination(SourceType, MachineType, SerialNumber,DownlineDateFrom,DownlineDateTo,DJNGItemCode,BZNGItemCode , pageNum, numPerPage, SQLSort, ref TotalCount);
            this.rpMenu.DataBind();
        }
    }
}